package com.ndp.fb.rdb.db.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ndp.fb.rdb.api.FunctionRdbService;
import com.ndp.fb.rdb.db.DaoTemplate;
import com.ndp.fb.rdb.db.impl.mapper.DefaultRowMapper;
import com.ndp.fb.rdb.model.Function;

/**
 * Created by elvisxiong on 7/8/15.
 */
@Service
public class FunctionRdbServiceImpl extends DaoTemplate implements FunctionRdbService {

    @Override
    public Function getFunctionByClazzAndMethodName(String clazz, String methodName) {
        String sql = "SELECT * FROM function WHERE clazz = ?  and method_name = ?";
        return findOne(sql,new Object[]{clazz,methodName}, DefaultRowMapper.autoRowMapper(Function.class));
    }
}
